package com.qiaofang.applet.service.other.repository;

import com.qiaofang.applet.service.other.domain.CityCompany;
import com.qiaofang.applet.service.other.domain.Corporation;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author QF2019
 */
@Repository
public interface CityCompanyRepository extends MongoRepository<CityCompany, String> {

    /**
     * 根据属性查询数据
     * @param corporationCode
     * @return
     */
    List<CityCompany> findAllByCorporationCode(String corporationCode);

    CityCompany findOneByCompanyUuid(String companyUuid);

    void deleteAllByCorporationCode(String corporationCode);

    List<CityCompany> findCityCompaniesByCityCodeAndCorporationCode(String cityCode, String corporationCode);

    List<CityCompany> findAllByCorporationCodeAndCityCodeAndMainCityFlag(String corporationCode, String cityCode, Integer mainCityFlag);

    CityCompany findFirstBySubWebDomain(String subWebDomain);
}
